package org.example.medical.dto;

import java.time.LocalDate;

public class VisitRecordQueryDTO {
    private String patientName;
    private String doctorName;
    private String type;
    private LocalDate visitTime;
    private String department;
    private int page = 1;
    private int size = 10;

    // Getters and Setters
    public String getPatientName() {
        return patientName;
    }

    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }

    public String getDoctorName() {
        return doctorName;
    }

    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public LocalDate getVisitTime() {
        return visitTime;
    }

    public void setVisitTime(LocalDate visitTime) {
        this.visitTime = visitTime;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        if (page < 1) {
            this.page = 1;
        } else {
            this.page = page;
        }
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        if (size < 1 || size > 100) {
            this.size = 10;
        } else {
            this.size = size;
        }
    }

    public int getOffset() {
        return (page - 1) * size;
    }
}